Skip to content

feat(voice): add base_url config for OpenAI TTS and Whisper STT#499

Merged
penso merged 5 commits intomainfrom
feat/voice-base-url
Apr 13, 2026
Merged

feat(voice): add base_url config for OpenAI TTS and Whisper STT#499
penso merged 5 commits intomainfrom
feat/voice-base-url

Conversation

@penso
Copy link
Copy Markdown
Collaborator

@penso penso commented Mar 28, 2026

Summary

Cherry-picked from #331 (which contained multiple unrelated features).

Enables pointing the OpenAI-compatible TTS/STT providers at local servers like Chatterbox and faster-whisper-server without needing an API key.

  • Adds base_url field to OpenAI TTS provider config
  • Adds base_url field to Whisper STT provider config
  • Both fall back to the default OpenAI API URL when not set

Validation

Completed

  • cargo check -p moltis-voice
  • Rust fmt check

Remaining

  • ./scripts/local-validate.sh
  • Manual: configure base_url pointing to a local TTS server, verify audio generation
  • Manual: configure base_url pointing to a local Whisper server, verify transcription

Manual QA

  1. Set voice.tts.openai.base_url in config to a local Chatterbox instance
  2. Request TTS — verify it hits the local server
  3. Set voice.stt.whisper.base_url to a local faster-whisper-server
  4. Send audio — verify transcription uses local server

Supersedes the voice portion of #331.

tensiondriven and others added 2 commits March 28, 2026 10:03
…ders

Enables pointing the OpenAI-compatible TTS/STT providers at local servers
like Chatterbox and faster-whisper-server without needing an API key.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 28, 2026

Greptile Summary

This PR adds an optional base_url field to both the OpenAI TTS and Whisper STT providers, enabling users to point them at OpenAI-compatible local servers (Chatterbox, faster-whisper-server) without an API key. The change touches the voice crate config types, the gateway config schema, the validator's schema map, the config template, and documentation.

Prior review concerns (trailing-slash double-slash and the missing Whisper template entry) have been addressed in the follow-up commit (fix(voice): address PR review feedback): both providers now call normalize_base_url that trims trailing slashes, tests cover that path, and the fix is consistent across TTS and STT.

Confidence Score: 5/5

Safe to merge — feature is correctly implemented end-to-end with no P0/P1 issues remaining.

All prior review concerns (trailing-slash double-slash URLs, missing Whisper template entry) were resolved in the follow-up commit. Schema map, gateway wiring, config structs, normalization logic, and test coverage are all consistent and correct across both providers.

crates/config/src/template.rs — Whisper STT block still lacks a commented base_url example (flagged in prior thread, not yet resolved).

Important Files Changed

Filename Overview
crates/voice/src/tts/openai.rs Adds base_url field with normalize_base_url helper; trailing-slash trimming and test coverage are both present. is_configured correctly treats custom base URL as a configured state.
crates/voice/src/stt/whisper.rs Mirrors the TTS implementation: normalize_base_url, with_options constructor, is_configured logic, and tests are all consistent and correct.
crates/config/src/schema.rs Adds base_url: Option to VoiceOpenAiConfig (TTS) and VoiceWhisperConfig (STT) in the gateway config schema.
crates/config/src/validate.rs Schema map updated with base_url under both voice.tts.openai and voice.stt.whisper; no missing entries for the new fields.
crates/config/src/template.rs TTS base_url commented example is present (line 770). The Whisper STT block (line 774-776) still lacks a commented base_url example, noted in a prior thread.
crates/gateway/src/voice.rs Both load_config (TTS path) and create_provider (STT path) correctly pass base_url from the gateway config down to the voice provider constructors. list_providers also correctly gates Whisper as configured when base_url is set.
docs/src/voice.md Both TTS and STT sections now document base_url with example local-server values.

Reviews (3): Last reviewed commit: "fix(voice): address PR review feedback" | Re-trigger Greptile

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 72.54902% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/gateway/src/voice.rs 18.75% 13 Missing ⚠️
crates/gateway/src/methods/services.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Mar 28, 2026

Merging this PR will not alter performance

✅ 39 untouched benchmarks
⏩ 5 skipped benchmarks1


Comparing feat/voice-base-url (0cc33f5) with main (bad43a1)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

penso added 2 commits April 13, 2026 09:10
# Conflicts:
#	crates/gateway/src/voice.rs
#	crates/voice/src/stt/whisper.rs
Entire-Checkpoint: cad39ab3ba27
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 13, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
withered-breeze-e956 645c27c Commit Preview URL

Branch Preview URL
Apr 13 2026, 08:15 AM

@penso penso merged commit 0b3338f into main Apr 13, 2026
23 of 33 checks passed
@penso penso deleted the feat/voice-base-url branch April 13, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants